
//系统目录 / 西药 接口相关的函数
import request from "../../untils/request.js"

/**
 * 
 *  post
 *  
 */

//登录函数
export const login = (data) => {
    return request.post("/outpatient/login",data)
}

//新建西成药目录
export const addDrugInformation = (data) => {
    return request.post("/outpatient/addDrugInformation",data)
}

//新建药典目录
export const addDrugs = (data) => {
    return request.post("/outpatient/addDrugs",data)
}

//修改西成药目录
export const updateDrugInformation = (data) => {
    return request.post("/outpatient/updateDrugInformation",data)
}

// Excel导入接口
export const importExcel = (formData) => {
    return request.post("/outpatient/import", formData, {
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        transformRequest: [data => data] // 禁用axios的默认转换
    })
}

/**
 * 
 * get 
 *  
 */

// 树菜单
export const AllTree = (params) => {
    return request.get("/outpatient/selectAllDrugCategory", { params })
}

// 本位码
export const ProductNameCode = (params) => {
    return request.get("/outpatient/selectByProductName", { params })
}

// 通过树形结构为参数比如点击西药就查出西药的数据查询对应的数据
export const getDrugType = (params) => {
    return request.get("/outpatient/getDrugType", { params })
}

// 公共目录的树形结构 （药品类型）
export const selectCateGory = (params) => {
    return request.get("/outpatient/selectCateGory", { params })
}

// 点击树形结构查询对应数据
export const getTreeData = (params) => {
    return request.get("/outpatient/getTreeData", { params })
}

// 药物类别
export const selectOneCateGory = (params) => {
    return request.get("/outpatient/selectOneCateGory", { params })
}

// 药物类别2级分类 药理子类别
export const selectTwoCateGory = (params) => {
    return request.get("/outpatient/selectTwoCateGory", { params })
}

// 药物类别3级分类 药理3子类别
export const selectThreeCateGory = (params) => {
    return request.get("/outpatient/selectThreeCateGory", { params })
}

// 列表，带条件查询，带分页  => 剂型
export const selectDrugDosageForm = (params) => {
    return request.get("/outpatient/selectDrugDosageForm", { params })
}

// 毒麻类型 all
export const selectDocVtByType = (params) => {
    return request.get("/outpatient/selectDocVtByType", { params })
}

//病案费别
export const getRecordCategory = (params) => {
    return request.get("/outpatient/getRecordCategory", { params })
}

// 药典目录列表
export const selectDrugCatalogue = (params) => {
    return request.get("/outpatient/selectDrugCatalogue", { params })
}

// 西成药目录列表，带分页查询，和条件查询
export const getDrugList = (params) => {
    return request.get("/outpatient/getDrugList", { params })
}

// 查用于新建西城药目录的 药典名称模糊查询
export const selectByDrugCatalogue = (params) => {
    return request.get("/outpatient/selectByDrugCatalogue", { params })
}

// 该查询是西成药信息用于修改回填数据
export const getDInfos = (params) => {
    return request.get("/outpatient/getDInfos", { params })
}

// 获取厂家信息
export const getManufacturer = (params) => {
    return request.get("/outpatient/getManufacturer", { params })
}

// 改查西成药厂家信息用于修改回填数据
export const getDrugManufacturer = (params) => {
    return request.get("/outpatient/getDrugManufacturer", { params })
}
// 新增药品基础信息-查询加成率
export const docMarkById = (params) => {
    return request.get("/outpatient/docMark/getById", { params })
}
//删除
export const deleteDrugP = (params) => {
    return request.get("/outpatient/deleteDrugP", { params })
}

/**
 * 
 * DELETE 
 *  
 */   


// 暴露
export default{
AllTree,getTreeData,importExcel,
ProductNameCode,getDrugType,selectDrugCatalogue,selectOneCateGory,selectTwoCateGory,selectThreeCateGory,addDrugs,deleteDrugP,getDInfos,
selectDrugDosageForm,
selectDocVtByType,getRecordCategory,
getDrugList,docMarkById,
selectByDrugCatalogue,addDrugInformation,updateDrugInformation,
getManufacturer,getDrugManufacturer
}